#ifndef LIGHTS_H
#define LIGHTS_H

/*This file contains the OpenGL code necessary for creating lights*/

#include <stdlib.h>
#include <QGLWidget>

//struct for containing values for each type of light in a light
struct lit{
    float ambient[4];
    float specular[4];
    float diffuse[4];
    float position[4];
    lit *next;//maybe connect to other lights in linked list, maybe not

    lit(float am[], float spec[], float dif[], float pos[]){
        ambient[0]=am[0];
        ambient[1]=am[1];
        ambient[2]=am[2];
        ambient[3]=am[3];
        specular[0]=spec[0];
        specular[1]=spec[1];
        specular[2]=spec[2];
        specular[3]=spec[3];
        diffuse[0]=dif[0];
        diffuse[1]=dif[1];
        diffuse[2]=dif[2];
        diffuse[3]=dif[3];
        position[0]=pos[0];
        position[1]=pos[1];
        position[2]=pos[2];
        position[3]=pos[3];
        next=NULL;
    }
};

//class for creating lights in a linked list, and turning them on or off
class lights
{
public:
    lights();                                                        //creates a default light
    lights(float position[], float ambient[], float specular[], float diffuse[]);//creates the given light
    ~lights();                                                       //destroys all lights

    void turnOnLights();                                              //activate all lights, and enable lighting
    void addLight(float position[], float ambient[], float specular[], float diffuse[]); //create light of given type and position
    void turnOffLights();                                             //deactivate lighting in general

    //store lights in list
    lit* myLights;
};

#endif // LIGHTS_H
